<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>sysmonpsu: xsysmonpsu_ams_example.c File Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="HTML_custom.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="xlogo_bg.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">sysmonpsu
   </div>
   <div id="projectbrief">Vitis Drivers API Documentation</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Overview</span></a></li>
      <li><a href="annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="globals.html"><span>APIs</span></a></li>
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="pages.html"><span>Examples</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('xsysmonpsu__ams__example_8c.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">xsysmonpsu_ams_example.c File Reference</div>  </div>
</div><!--header-->
<div class="contents">
<a name="details" id="details"></a><h2 class="groupheader">Overview</h2>
<div class="textblock"><p>This file contains a design example using the driver functions of the System Monitor driver. </p>
<p>This example here shows the usage of the driver/device in single channel sequencer off mode to measure AMS block voltages.</p>
<dl class="section note"><dt>Note</dt><dd></dd></dl>
<p>This code assumes that no Operating System is being used.</p>
<p>The value of the on-chip Vccint voltage is read from the device and then the alarm thresholds are set in such a manner that the alarm occurs.</p>
<pre></pre><pre>MODIFICATION HISTORY:</pre><pre>Ver   Who    Date     Changes
</p>
<hr/>
<p>
1.0   mn     12/13/17 First release
2.4   mn     04/26/18 Remove usleeps from AMS CTRL example
2.5   aad    08/26/19 Added local timeout poll function for IAR compiler
                support
2.9   cog    07/20/23 Added support for SDT flow.</pre><pre></pre> </div><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:a811838a7c15bd01594742f2aef90b628"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xsysmonpsu__ams__example_8c.html#a811838a7c15bd01594742f2aef90b628">SysMonPsuAMSExample</a> (XScuGic *XScuGicInstancePtr, <a class="el" href="struct_x_sys_mon_psu.html">XSysMonPsu</a> *SysMonInstPtr, u32 SysMonDeviceId, u16 SysMonIntrId)</td></tr>
<tr class="memdesc:a811838a7c15bd01594742f2aef90b628"><td class="mdescLeft">&#160;</td><td class="mdescRight">This function runs a test on the System Monitor device using the driver APIs.  <a href="#a811838a7c15bd01594742f2aef90b628">More...</a><br/></td></tr>
<tr class="separator:a811838a7c15bd01594742f2aef90b628"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a840291bc02cba5474a4cb46a9b9566fe"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="xsysmonpsu__ams__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main</a> (void)</td></tr>
<tr class="memdesc:a840291bc02cba5474a4cb46a9b9566fe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Main function that invokes the Single Channel Interrupt example.  <a href="#a840291bc02cba5474a4cb46a9b9566fe">More...</a><br/></td></tr>
<tr class="separator:a840291bc02cba5474a4cb46a9b9566fe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="a840291bc02cba5474a4cb46a9b9566fe"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int main </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Main function that invokes the Single Channel Interrupt example. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">None.</td><td></td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the example has completed successfully.</li>
<li>XST_FAILURE if the example has failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>None. </dd></dl>

<p>References <a class="el" href="xsysmonpsu__ams__example_8c.html#a811838a7c15bd01594742f2aef90b628">SysMonPsuAMSExample()</a>.</p>

</div>
</div>
<a class="anchor" id="a811838a7c15bd01594742f2aef90b628"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int SysMonPsuAMSExample </td>
          <td>(</td>
          <td class="paramtype">XScuGic *&#160;</td>
          <td class="paramname"><em>XScuGicInstancePtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="struct_x_sys_mon_psu.html">XSysMonPsu</a> *&#160;</td>
          <td class="paramname"><em>SysMonInstPtr</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u32&#160;</td>
          <td class="paramname"><em>SysMonDeviceId</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">u16&#160;</td>
          <td class="paramname"><em>SysMonIntrId</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This function runs a test on the System Monitor device using the driver APIs. </p>
<p>The function does the following tasks:</p>
<ul>
<li>Initiate the System Monitor device driver instance</li>
<li>Run self-test on the device</li>
<li>Reset the device</li>
<li>Set up alarm for VCCINT</li>
<li>Set up the configuration registers for single channel continuous mode for VCCINT channel</li>
<li>Setup interrupt system</li>
<li>Enable interrupts</li>
<li>Wait until the VCCINT alarm interrupt occurs</li>
</ul>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">XScuGicInstancePtr</td><td>is a pointer to the Interrupt Controller driver Instance. </td></tr>
    <tr><td class="paramname">SysMonInstPtr</td><td>is a pointer to the XSysMon driver Instance. </td></tr>
    <tr><td class="paramname">SysMonDeviceId</td><td>is the XPAR_&lt;SYSMON_instance&gt;_DEVICE_ID value from xparameters.h. </td></tr>
    <tr><td class="paramname">SysMonIntrId</td><td>is XPAR_&lt;SYSMON_instance&gt;_VEC_ID value from xparameters_ps.h</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd><ul>
<li>XST_SUCCESS if the example has completed successfully.</li>
<li>XST_FAILURE if the example has failed.</li>
</ul>
</dd></dl>
<dl class="section note"><dt>Note</dt><dd>This function may never return if no interrupt occurs. </dd></dl>

<p>References <a class="el" href="struct_x_sys_mon_psu___config.html#a0166b8968529950a2b997038b7d99f16">XSysMonPsu_Config::BaseAddress</a>, <a class="el" href="struct_x_sys_mon_psu.html#a37b1b3b387db33d8aedcbe611b27e45b">XSysMonPsu::Config</a>, <a class="el" href="xsysmonpsu_8h.html#a2526be2a1f3319c068088aade1c73eb2">XSM_CH_DDRPHY_VREF</a>, <a class="el" href="xsysmonpsu_8h.html#ae411c55817a64b2351271181ebdae254">XSM_CH_RESERVE1</a>, <a class="el" href="xsysmonpsu_8h.html#a432956207f2e1b259f9d320739b5d286">XSM_CH_VCC_PSDDRPLL</a>, <a class="el" href="xsysmonpsu_8h.html#a367867d9ef353a759eb5d33620bffed4">XSM_CH_VCC_PSLL0</a>, <a class="el" href="xsysmonpsu_8h.html#a8b87dfb4207793ed9043629c32488aa7">XSM_CH_VCC_PSLL3</a>, <a class="el" href="xsysmonpsu_8h.html#a1c6a2517306958c69f3259057d3649a9">XSM_CH_VCCAUX</a>, <a class="el" href="xsysmonpsu_8h.html#a3c791d8747031b6e7fdc85cac810241a">XSM_CH_VCCBRAM</a>, <a class="el" href="xsysmonpsu_8h.html#a715e29a748cdd1b301bec9ac17c4c7f4">XSM_CH_VCCINT</a>, <a class="el" href="xsysmonpsu_8h.html#a3c4487fa8b08f41c807433ef456abc75">XSM_SEQ_MODE_SINGCHAN</a>, <a class="el" href="xsysmonpsu_8c.html#a8cd0584410c0931f931aa4da1e3e151b">XSysMonPsu_CfgInitialize()</a>, <a class="el" href="xsysmonpsu_8c.html#a54eb6ba4c6f594b75d402cde03f6e173">XSysMonPsu_GetAdcData()</a>, <a class="el" href="xsysmonpsu_8h.html#a7c41996bf95cd7119dba302246345a9d">XSysMonPsu_IntrClear()</a>, <a class="el" href="xsysmonpsu_8h.html#a3ef44a74426b13480363747a5dedc5d0">XSysMonPsu_IntrGetStatus()</a>, <a class="el" href="xsysmonpsu__hw_8h.html#a4f60260a330cb9d25d5ff40a293442c5">XSYSMONPSU_ISR_1_OFFSET</a>, <a class="el" href="xsysmonpsu_8h.html#a948f08280b6195869015382d92ba8a50">XSysMonPsu_LookupConfig()</a>, <a class="el" href="xsysmonpsu_8h.html#af6667f0fcc65dda4a7af897b2924143c">XSysMonPsu_RawToVoltage</a>, <a class="el" href="xsysmonpsu_8h.html#a39d8d59cc35fe4151b51b5bbafdca2ca">XSysMonPsu_SelfTest()</a>, <a class="el" href="xsysmonpsu_8c.html#aa4bdb4e555b2c8d47a0185862c9cb4c6">XSysMonPsu_SetSequencerMode()</a>, and <a class="el" href="xsysmonpsu_8c.html#a872e9a41818489e77fa554dd01408281">XSysMonPsu_SetSingleChParams()</a>.</p>

<p>Referenced by <a class="el" href="xsysmonpsu__ams__example_8c.html#a840291bc02cba5474a4cb46a9b9566fe">main()</a>.</p>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
	<p class="footer">&copy; Copyright 2015-2022 Xilinx, Inc. All Rights Reserved.</p>
	<p class="footer">&copy; Copyright 2022-2023 Advanced Micro Devices, Inc. All Rights Reserved.</p>
</div>
</body>
</html>
